home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005.7z / CHIP Utilities 2005.iso / images / freesco.igz / freesco.img / router / rc / rc_eth < prev    next >
Encoding:
Text File  |  2003-05-03  |  618 b   |  31 lines

  1. #!/bin/sh
  2. #
  3. # Start ethernet router (gateway - interface0)
  4.  
  5. . /etc/colors
  6. . /etc/system.cfg
  7. . /etc/chat.pwd
  8. . /etc/live.cfg
  9.  
  10. [ "$ROUTER" = ethernet ] || exit 
  11. [ "$USEPPP0" = y ] && exit
  12.  
  13. stp()    { route del default 2>/dev/null; }
  14. str()    {
  15.     echo -n "Adding default route...            "
  16.     if [ "$USEDHCP0" = y -a ! -f /etc/dhcpc/dhcpcd-${INTNAME0}.info ]; then
  17.         echo "${CR}Failed$CW /$CY Delayed$CW"
  18.         exit
  19.     fi    
  20.     [ "$GATEWAY" ] && a="gw $GATEWAY"
  21.     route add default $a $INTNAME0
  22.     = $? "Done $CC $GATEWAY$CW"
  23. }
  24.  
  25. case "$1" in
  26.     start)    str;;
  27.     stop)    stp;;
  28.     restart|newip) stp;str;;
  29.     status) route -n | sed -n /default/P;;
  30. esac
  31.